﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.IO;

namespace Com.CMS263.BLL
{
   public class CMSPage:Page
    {
       protected override void Render(System.Web.UI.HtmlTextWriter writer)
       {
           string content = string.Empty;
           StringWriter stringWriter = new StringWriter();
           HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
           try
           {
               // 将当前页面的内容呈现到临时的 HtmlTextWriter 对象中   
               base.Render(htmlWriter);
               htmlWriter.Close();
               // 得到当前页面的全部内容   
               content = stringWriter.ToString();
               // 替换页面中的部分内容  
               TransformList alt = new  TransformList(content);
               content = alt.GetResulte();
               //GetTag(content, "cms:list");
               //GetTag(content,"cms:art");
               //foreach (string tag in tagList)
               //{
               //    TransformArtListTag(tag);
               //}
               // 将新页面的内容显示出来   
               writer.Write(content);
           }
           catch { }
           finally
           {
               stringWriter.Dispose();
               htmlWriter.Close();
               htmlWriter.Dispose();
           }


       }
    }
}
